package com.koalac.ironman.net.pojo.response;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class SchoolTravelDetail extends BaseResponse{
	
	private String id;
	private String name;
	private String headImgUrl;

	private int beforePrice;
	private int afterPrice;
	private int fiftyPrice;

	private int fourPrice;
	private int thirtyPrice;
	private String remark;

	private String startPlace;
	private String priceMessage;
	private String ruleMessage;

	private String message;
	private String passFlag;
	private String firstFlag;

	private String productFlag;
	private String travelNumber;
	private String followNumber;
	
	private String publish;
	private String dateline;
	private List<GoodPicture> goodPictureList = new ArrayList<GoodPicture>();
	private List<ProductdateData> productdateDataList = new ArrayList<ProductdateData>();
	/**
	 * 额外的字段
	 */
	private double selectPrice;
	/**
	 * 出团人数的范围
	 */
	private int maxFollowNumber;
	private int minFollowNumber;
	
	@Override
	public void init(JSONObject source) {
		if (source != null) {
			setId(source.optString("id"));
			setName(source.optString("name"));
			setHeadImgUrl(source.optString("head_img_url"));
			
			setBeforePrice(source.optInt("before_price"));
			setAfterPrice(source.optInt("after_price"));
			setFiftyPrice(source.optInt("fifty_price"));
			
			setFourPrice(source.optInt("fourty_price"));
			setThirtyPrice(source.optInt("thirty_price"));
			setRemark(source.optString("remark"));
			
			setStartPlace(source.optString("start_place"));
			setPriceMessage(source.optString("price_message"));
			setRuleMessage(source.optString("rule_message"));
			
			setMessage(source.optString("message"));
			setPassFlag(source.optString("pass_flag"));
			setFirstFlag(source.optString("first_flag"));
			
			setProductFlag(source.optString("product_flag"));
			setTravelNumber(source.optString("travel_number"));
			setFollowNumber(source.optString("follow_number"));
			
			setPublish(source.optString("publish"));
			setDateline(source.optString("dateline"));
			JSONArray goodpicturejsonArray = source.optJSONArray("Goodpicture");
			if (goodpicturejsonArray != null) {
			    for (int i = 0; i < goodpicturejsonArray.length(); i++) {
				    JSONObject jsonObject = goodpicturejsonArray.optJSONObject(i);
				    GoodPicture goodPicture = new GoodPicture();
				    goodPicture.init(jsonObject);
				    goodPictureList.add(goodPicture);
				}
			}
			
			JSONArray productdateDataJsonArray = source.optJSONArray("ProductdateData");
			if (productdateDataJsonArray != null) {
			    for (int i = 0; i < productdateDataJsonArray.length(); i++) {
				    JSONObject jsonObject = productdateDataJsonArray.optJSONObject(i);
				    ProductdateData productdateData = new ProductdateData();
				    productdateData.init(jsonObject);
				    productdateDataList.add(productdateData);
				}
			}
		}
	}
	
	public int getMaxFollowNumber() {
	    return maxFollowNumber;
	}


	public void setMaxFollowNumber(int maxFollowNumber) {
	    this.maxFollowNumber = maxFollowNumber;
	}


	public int getMinFollowNumber() {
	    return minFollowNumber;
	}


	public void setMinFollowNumber(int minFollowNumber) {
	    this.minFollowNumber = minFollowNumber;
	}

	public double getSelectPrice() {
	    return selectPrice;
	}

	public void setSelectPrice(double selectPrice) {
	    this.selectPrice = selectPrice;
	}
	
	public List<GoodPicture> getGoodPictureList() {
	    return goodPictureList;
	}

	public void setGoodPictureList(List<GoodPicture> goodPictureList) {
	    this.goodPictureList = goodPictureList;
	}

	public List<ProductdateData> getProductdateDataList() {
	    return productdateDataList;
	}

	public void setProductdateDataList(List<ProductdateData> productdateDataList) {
	    this.productdateDataList = productdateDataList;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getHeadImgUrl() {
		return headImgUrl;
	}
	public void setHeadImgUrl(String headImgUrl) {
		this.headImgUrl = headImgUrl;
	}
	public int getBeforePrice() {
		return beforePrice;
	}
	public void setBeforePrice(int beforePrice) {
		this.beforePrice = beforePrice;
	}
	public int getAfterPrice() {
		return afterPrice;
	}
	public void setAfterPrice(int afterPrice) {
		this.afterPrice = afterPrice;
	}
	public int getFiftyPrice() {
		return fiftyPrice;
	}
	public void setFiftyPrice(int fiftyPrice) {
		this.fiftyPrice = fiftyPrice;
	}
	public int getFourPrice() {
		return fourPrice;
	}
	public void setFourPrice(int fourPrice) {
		this.fourPrice = fourPrice;
	}
	public int getThirtyPrice() {
		return thirtyPrice;
	}
	public void setThirtyPrice(int thirtyPrice) {
		this.thirtyPrice = thirtyPrice;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getStartPlace() {
		return startPlace;
	}
	public void setStartPlace(String startPlace) {
		this.startPlace = startPlace;
	}
	public String getPriceMessage() {
		return priceMessage;
	}
	public void setPriceMessage(String priceMessage) {
		this.priceMessage = priceMessage;
	}
	public String getRuleMessage() {
		return ruleMessage;
	}
	public void setRuleMessage(String ruleMessage) {
		this.ruleMessage = ruleMessage;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getPassFlag() {
		return passFlag;
	}
	public void setPassFlag(String passFlag) {
		this.passFlag = passFlag;
	}
	public String getFirstFlag() {
		return firstFlag;
	}
	public void setFirstFlag(String firstFlag) {
		this.firstFlag = firstFlag;
	}
	public String getProductFlag() {
		return productFlag;
	}
	public void setProductFlag(String productFlag) {
		this.productFlag = productFlag;
	}
	public String getTravelNumber() {
		return travelNumber;
	}
	public void setTravelNumber(String travelNumber) {
		this.travelNumber = travelNumber;
	}
	public String getFollowNumber() {
		return followNumber;
	}
	public void setFollowNumber(String followNumber) {
		this.followNumber = followNumber;
	}
	public String getPublish() {
		return publish;
	}
	public void setPublish(String publish) {
		this.publish = publish;
	}
	public String getDateline() {
		return dateline;
	}
	public void setDateline(String dateline) {
		this.dateline = dateline;
	}
}
